﻿CREATE VIEW [dbo].[ClaimInformation]
AS
SELECT     dbo.Interchange.InterchangeControlVersionNumber, dbo.FunctionalGroup.GroupControlNumber, dbo.TransactionSet.TransactionSetControlNumber, 
                      dbo.Claim.PatientAccountNumber, dbo.Subscriber.SubscriberPrimaryIdentifier, dbo.Subscriber.HierarchicalIDNumber, 
                      dbo.ClaimLineItems.AssignedNumber, dbo.ClaimLineItems.LineItemChargeAmount, dbo.Interchange.InterchangeSenderID, 
                      dbo.Interchange.InterchangeReceiverID, dbo.Interchange.InterchangeDate, dbo.Interchange.InterchangeTime, dbo.Interchange.EDIMessageType, 
                      dbo.Subscriber.SubscriberLastOrOrganizationName, dbo.Subscriber.SubscriberFirstName, dbo.Subscriber.SubscriberCityName, 
                      dbo.Subscriber.SubscriberStateCode, dbo.Subscriber.SubscriberPostalCode, dbo.Subscriber.SubscriberGenderCode, 
                      dbo.Subscriber.SubscriberBirthDate, dbo.Subscriber.PayerLastOrOrganizationName, dbo.Claim.TotalClaimChargeAmount, 
                      dbo.Claim.PayerEstimatedMonetaryAmount, dbo.Claim.PatientEstimatedMonetaryAmount, dbo.Claim.PatientPaidMonetaryAmount, 
                      dbo.Claim.MedicalRecordNumber, dbo.Claim.DRGCode, dbo.Claim.PrincipalProcedureCode, dbo.Claim.AttendingPhysicianLastName, 
                      dbo.Claim.AttendingPhysicianPrimaryIdentifier, dbo.Claim.AttendingPhysicianSpecialtyCode, dbo.ClaimLineItems.ServiceDate, 
                      dbo.ClaimLineItems.ServiceLineRevenueCode, dbo.ClaimLineItems.ServiceUnitCount, dbo.ClaimLineItems.ServiceLineRate, 
                      dbo.ClaimLineItems.UnitOrBasisForMeasurementCode, dbo.Interchange.InterchangeControlStandardsIdentifier, 
                      dbo.Interchange.InterchangeControlNumber AS Expr1, dbo.Interchange.AcknowledgementRequested, dbo.FunctionalGroup.ApplicationSenderCode, 
                      dbo.FunctionalGroup.ApplicationReceiverCode
FROM         dbo.Subscriber INNER JOIN
                      dbo.TransactionSet INNER JOIN
                      dbo.Interchange INNER JOIN
                      dbo.FunctionalGroup ON dbo.Interchange.BTSMessageID = dbo.FunctionalGroup.BTSMessageID ON 
                      dbo.TransactionSet.BTSMessageID = dbo.Interchange.BTSMessageID ON 
                      dbo.Subscriber.BTSMessageID = dbo.Interchange.BTSMessageID INNER JOIN
                      dbo.Claim ON dbo.Interchange.BTSMessageID = dbo.Claim.BTSMessageID INNER JOIN
                      dbo.ClaimLineItems ON dbo.Interchange.BTSMessageID = dbo.ClaimLineItems.BTSMessageID


GO
EXEC sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1[50] 4[25] 3) )"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 1
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "Interchange"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 224
               Right = 305
            End
            DisplayFlags = 280
            TopColumn = 13
         End
         Begin Table = "FunctionalGroup"
            Begin Extent = 
               Top = 24
               Left = 380
               Bottom = 210
               Right = 643
            End
            DisplayFlags = 280
            TopColumn = 6
         End
         Begin Table = "TransactionSet"
            Begin Extent = 
               Top = 14
               Left = 720
               Bottom = 154
               Right = 966
            End
            DisplayFlags = 280
            TopColumn = 33
         End
         Begin Table = "Subscriber"
            Begin Extent = 
               Top = 231
               Left = 789
               Bottom = 404
               Right = 1039
            End
            DisplayFlags = 280
            TopColumn = 50
         End
         Begin Table = "Claim"
            Begin Extent = 
               Top = 238
               Left = 381
               Bottom = 473
               Right = 632
            End
            DisplayFlags = 280
            TopColumn = 36
         End
         Begin Table = "ClaimLineItems"
            Begin Extent = 
               Top = 295
               Left = 34
               Bottom = 476
               Right = 275
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
      PaneHidden = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 38
         Width = 284', 'SCHEMA', N'dbo', 'VIEW', N'ClaimInformation', NULL, NULL
GO
EXEC sp_addextendedproperty N'MS_DiagramPane2', N'
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
', 'SCHEMA', N'dbo', 'VIEW', N'ClaimInformation', NULL, NULL
GO
EXEC sp_addextendedproperty N'MS_DiagramPaneCount', 2, 'SCHEMA', N'dbo', 'VIEW', N'ClaimInformation', NULL, NULL

